package com.yoki.loginview;

import android.content.Intent;
import android.database.Cursor;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.yoki.loginview.Save.SaveString;
import com.yoki.loginview.db.AccountDBHelper;

public class SelfmessageActivity extends AppCompatActivity {

    TextView id;
    TextView gender;
    TextView phone;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_selfmessage);
        id = findViewById(R.id.idText);
        gender = findViewById(R.id.genText);
        phone = findViewById(R.id.phoneText2);
        AccountDBHelper helper = new AccountDBHelper(SelfmessageActivity.this,AccountDBHelper.VERSION_1);
        Cursor cursor = helper.select(null,null);
        cursor.move(SaveString.User+1);
        id.setText(cursor.getString(1));
        if(cursor.getString(3).equals("1"))
            gender.setText("男");
        else if(cursor.getString(3).equals("2"))
            gender.setText("女");
        phone.setText(cursor.getString(4));
        //id.setText(cursor.getString(1));
        //gender.setText(cursor.getString(3));
        //phone.setText(cursor.getString(4));
    }

}
